Page({
    data:{
        cars:[
            ["宝马","奥迪","奔驰","劳斯莱斯"],
            ["宝马1","宝马2","宝马3","宝马4"]
        ],
        arr:[0,0]
    },
    //列滚动
    columnChange(e){

        let {column,value}=e.detail;
        //如果滚动的是第1列，第2列内容跟随变动
        if(column==0){
            if(value==1){
                this.data.cars[1]=['奥迪1','奥迪2','奥迪3','奥迪4']
            }else if(value==2){
                this.data.cars[1]=['奔驰1','奔驰2','奔驰3','奔驰4']
            }else if(value==3){
                this.data.cars[1]=['劳斯莱斯1','劳斯莱斯2','劳斯莱斯3','劳斯莱斯4']
            }else{
                this.data.cars[1]=['宝马1','宝马2','宝马3','宝马4']
            }
            this.setData({
                cars:this.data.cars
            })
        }
        
    },
    //选择列
    carSelect(e){
        // console.log(e)
        this.setData({
            arr:e.detail.value
        })
    }
})